package com.bootdo.appsystem.domain;

import java.io.Serializable;
import java.util.Date;



/**
 * 
 * 
 * @author @fan
 * @email 1992lcg@163.com
 * @date 2018-07-16 16:38:39
 */
public class OrderaddressinfoDO implements Serializable {
	private static final long serialVersionUID = 1L;
	
	//订单地址编号
	private Integer id;
	//订单号
	private String ordercode;
	//订单时间
	private Date ordertime;
	//用户编号
	private Integer uid;
	//收货地址
	private String address;
	//收货联系方式
	private String phone;
	//订单状态
	private Integer status;
	//收货人姓名
	private String name;

	/**
	 * 获取：收货人姓名
	 */
	public String getName() {
		return name;
	}
	/**
	 * 设置：收货人姓名
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * 设置：订单地址编号
	 */
	public void setId(Integer id) {
		this.id = id;
	}
	/**
	 * 获取：订单地址编号
	 */
	public Integer getId() {
		return id;
	}
	/**
	 * 设置：订单号
	 */
	public void setOrdercode(String ordercode) {
		this.ordercode = ordercode;
	}
	/**
	 * 获取：订单号
	 */
	public String getOrdercode() {
		return ordercode;
	}
	/**
	 * 设置：订单时间
	 */
	public void setOrdertime(Date ordertime) {
		this.ordertime = ordertime;
	}
	/**
	 * 获取：订单时间
	 */
	public Date getOrdertime() {
		return ordertime;
	}
	/**
	 * 设置：用户编号
	 */
	public void setUid(Integer uid) {
		this.uid = uid;
	}
	/**
	 * 获取：用户编号
	 */
	public Integer getUid() {
		return uid;
	}
	/**
	 * 设置：收货地址
	 */
	public void setAddress(String address) {
		this.address = address;
	}
	/**
	 * 获取：收货地址
	 */
	public String getAddress() {
		return address;
	}
	/**
	 * 设置：收货联系方式
	 */
	public void setPhone(String phone) {
		this.phone = phone;
	}
	/**
	 * 获取：收货联系方式
	 */
	public String getPhone() {
		return phone;
	}
	/**
	 * 设置：订单状态
	 * 0、未支付
	 * 1、已支付，商家未确认
	 *
	 *
	 */
	public void setStatus(Integer status) {
		this.status = status;
	}
	/**
	 * 获取：订单状态
	 */
	public Integer getStatus() {
		return status;
	}


	/**
	 * 创建一个商品订单数据记录
	 * @param shipaddressDO
	 * @return
	 */
	public OrderaddressinfoDO creatNewAddressByShip(ShipaddressDO shipaddressDO){
		OrderaddressinfoDO orderaddressinfoDO = new OrderaddressinfoDO();
		orderaddressinfoDO.setOrdertime(new Date());
		String city = shipaddressDO.getCityname();
		if(city.equals("请选择")){
			city = "";
		}
		orderaddressinfoDO.setAddress(shipaddressDO.getProvincename() + city + shipaddressDO.getDistrictnname() + shipaddressDO.getStringname() + shipaddressDO.getAddress());
		orderaddressinfoDO.setPhone(shipaddressDO.getMobile());
		orderaddressinfoDO.setStatus(0);
		orderaddressinfoDO.setUid(shipaddressDO.getUid());
		orderaddressinfoDO.setName(shipaddressDO.getConsignee());
		return orderaddressinfoDO;
	}

}
